package com.sunny.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "sun_local_disk", schema = "crawler", catalog = "")
public class SunLocalDiskEntity {
    private long diskId;
    private String diskVolume;
    private String diskName;
    private String ownUser;
    private String comment;

    @Id
    @Column(name = "disk_id")
    public long getDiskId() {
        return diskId;
    }

    public void setDiskId(long diskId) {
        this.diskId = diskId;
    }

    @Basic
    @Column(name = "disk_volume")
    public String getDiskVolume() {
        return diskVolume;
    }

    public void setDiskVolume(String diskVolume) {
        this.diskVolume = diskVolume;
    }

    @Basic
    @Column(name = "disk_name")
    public String getDiskName() {
        return diskName;
    }

    public void setDiskName(String diskName) {
        this.diskName = diskName;
    }

    @Basic
    @Column(name = "own_user")
    public String getOwnUser() {
        return ownUser;
    }

    public void setOwnUser(String ownUser) {
        this.ownUser = ownUser;
    }

    @Basic
    @Column(name = "comment")
    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SunLocalDiskEntity that = (SunLocalDiskEntity) o;
        return diskId == that.diskId &&
                Objects.equals(diskVolume, that.diskVolume) &&
                Objects.equals(diskName, that.diskName) &&
                Objects.equals(ownUser, that.ownUser) &&
                Objects.equals(comment, that.comment);
    }

    @Override
    public int hashCode() {
        return Objects.hash(diskId, diskVolume, diskName, ownUser, comment);
    }
}
